package com.zmj.sy.mom.srv.aps.controller;


import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseIdReqVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BasePageResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.logapi.*;
import com.zmj.sy.mom.srv.aps.service.LogApiService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@Api(tags = "日志管理-接口日志")
@RestController
@RequestMapping("/logApi")
public class LogApiController {

    private final LogApiService logApiService;
    @ApiOperation("日志列表")
    @GetMapping("/list")
    public BasePageResVo<LogApiListResVo> list(LogApiListReqVo reqVo){
        return logApiService.list(reqVo);
    }

    @ApiOperation("查看请求响应体")
    @GetMapping("/detail")
    public LogApiDetailResVo detail(BaseIdReqVo reqVo){
        return logApiService.detail(reqVo);
    }


    @ApiOperation("三方日志")
    @GetMapping("/log")
    public BasePageResVo<LogApiBusinessResVo> log(LogApiBusinessReqVo reqVo){
        return logApiService.log(reqVo);
    }

    @ApiOperation("三方日志详细信息")
    @GetMapping("/detailsan")
    public LogApiDetailResVo detailSan(BaseIdReqVo reqVo) {
        return logApiService.detailSan(reqVo);
    }

    @ApiOperation("通知QMS_SY失败重传")
    @PostMapping("/retransmission")
    public BaseResVo retransmission(BaseIdReqVo reqVo) {
        logApiService.retransmission(reqVo);
        return BaseResVo.ok();
    }

}
